package com.leixin.demo.dao;

import com.leixin.demo.entity.UrlEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface UrlDao {
   //新增数据
   @Insert("INSERT INTO url3 (id,url,name,urlavi,urlimg) VALUE (#{id}, #{url}, #{name},#{urlavi},#{urlimg})")
    Integer insert(UrlEntity url);
   //查询数据
   @Select("SELECT * FROM url3 WHERE name like CONCAT('%','${name}','%' )")
    List<UrlEntity> selectname(UrlEntity url);
    //查询数据
    @Select("SELECT * FROM url3")
    List<UrlEntity> selectall();

    //查询图片地址
    @Select("SELECT id,urlimg FROM url3")
    List<UrlEntity> selectImg();
}
